package wangjg.security.http;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class HttpContext {
	private static ThreadLocal<HttpServletRequest> requestContext = new ThreadLocal<HttpServletRequest>();
	private static ThreadLocal<HttpServletResponse> responseContext = new ThreadLocal<HttpServletResponse>();

	public static void setRequest(HttpServletRequest request){
		requestContext.set(request);
	}

	public static void setResponse(HttpServletResponse response){
		responseContext.set(response);
	}
	
	public static HttpServletRequest getRequest(){
		return (HttpServletRequest) requestContext.get();
	}

	public static HttpServletResponse getResponse(){
		return (HttpServletResponse) responseContext.get();
	}

}
